From: Keir Fraser Date: Thu, 31 Jan 2008 09:11:21 +0000 (+0000) Subject: ioemu: Stop PV guest from parsing xenstore and opening block devices. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14341^2~28 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=87fdf3231c5f7998037b1962506dd1bb81cd4ac3;p=xen.git ioemu: Stop PV guest from parsing xenstore and opening block devices. PV guests are now using QEMU for a vncserver. During initialization of QEMU xenstore_parse_config() is being called causing PV guests to open block devices. This patch makes a new function, xenstore_daemon_open(), so that the vnc password functions have an open xenstore handle and moves xenstore_parse_config() into the FV machine specific init function. Signed-off-by: Pat Campbell --- diff --git a/tools/ioemu/hw/xen_machine_fv.c b/tools/ioemu/hw/xen_machine_fv.c index 22ba1dbc3f..794afeb236 100644 --- a/tools/ioemu/hw/xen_machine_fv.c +++ b/tools/ioemu/hw/xen_machine_fv.c @@ -205,6 +205,8 @@ static void xen_init_fv(uint64_t ram_size, int vga_ram_size, char *boot_device, } #endif + xenstore_parse_domain_config(domid); + xc_get_hvm_param(xc_handle, domid, HVM_PARAM_IOREQ_PFN, &ioreq_pfn); fprintf(logfile, "shared page at pfn %lx\n", ioreq_pfn); shared_page = xc_map_foreign_range(xc_handle, domid, XC_PAGE_SIZE, diff --git a/tools/ioemu/vl.c b/tools/ioemu/vl.c index 939149c46f..ce0b26c3e5 100644 --- a/tools/ioemu/vl.c +++ b/tools/ioemu/vl.c @@ -7593,7 +7593,7 @@ int main(int argc, char **argv) #ifdef CONFIG_DM bdrv_init(); xc_handle = xc_interface_open(); - xenstore_parse_domain_config(domid); + xenstore_daemon_open(); #endif /* CONFIG_DM */ #ifdef USE_KQEMU diff --git a/tools/ioemu/vl.h b/tools/ioemu/vl.h index 9d78cd25d9..e73ef3b6e9 100644 --- a/tools/ioemu/vl.h +++ b/tools/ioemu/vl.h @@ -1457,6 +1457,7 @@ void readline_start(const char *prompt, int is_password, ReadLineFunc *readline_func, void *opaque); /* xenstore.c */ +void xenstore_daemon_open(void); void xenstore_parse_domain_config(int domid); int xenstore_fd(void); void xenstore_process_event(void *opaque); diff --git a/tools/ioemu/xenstore.c b/tools/ioemu/xenstore.c index 9d33237cb3..0063a2eba9 100644 --- a/tools/ioemu/xenstore.c +++ b/tools/ioemu/xenstore.c @@ -77,6 +77,13 @@ static void waitForDevice(char *fn) return; } +void xenstore_daemon_open(void) +{ + xsh = xs_daemon_open(); + if (xsh == NULL) + fprintf(logfile, "Could not contact xenstore for domain config\n"); +} + void xenstore_parse_domain_config(int domid) { char **e = NULL; @@ -90,12 +97,6 @@ void xenstore_parse_domain_config(int domid) for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) media_filename[i] = NULL; - xsh = xs_daemon_open(); - if (xsh == NULL) { - fprintf(logfile, "Could not contact xenstore for domain config\n"); - return; - } - path = xs_get_domain_path(xsh, domid); if (path == NULL) { fprintf(logfile, "xs_get_domain_path() error\n");